const app = getApp()
Component({
    properties: {
      title: {
        type: String,
        value: true
      },
      showBack: {
        type: Boolean,
        value: true
      },
      //平面图标题白色
      color1: {
        type: Boolean,
        value: false
      },
      iconName: {
        type: String,
        value: 'arrow-left'
      },
    },
    data: {
      top: app.globalData.navMarginTop,
      height: app.globalData.navBarHeight,
    },
    lifetimes: {
      attached: function() {
        // 在组件实例进入页面节点树时执行
        // wx.getSystemInfo({
        //     success: (res) => {
        //       const ratio = 750 / res.windowWidth
        //       const menuInfo = wx.getMenuButtonBoundingClientRect();
        //       this.setData({
        //           top:  menuInfo.top * ratio ,
        //           left: menuInfo.left * ratio , 
        //           height: menuInfo.height * ratio ,
        //         })
        //         console.log(this.data.top);
        //         console.log(this.data.left);
        //         console.log(this.data.height);
        //     }
        //   })
      },
    },
    methods: {
      goBack() {
        if (this.properties.showBack) {
          wx.navigateBack()
        }
      },
    }
  });
  